Skip to content

fix(status): WATCH an Agent Editor project whose .mxmodule does not travel with the model (#778) - #786

Merged
MendixMau merged 4 commits into
masterfrom
triage/778-agent-editor-warn
Nov 16, 2026
Merged

MendixMau merged 4 commits into
masterfrom
triage/778-agent-editor-warn

Conversation

@MendixMau

Copy link
Copy Markdown
Owner

Fixes #778

Direct lane

What changed and why (one paragraph): This is option 1 of the triage (warn only, maintainer's go on 2026-11-16). Studio Pro reads the agenteditor.agent document type from modules/AgentEditor.mxmodule beside the .mpr. A sync of only .mpr + mprcontents/ left that file out of git, so the builder stayed green while every colleague's clone showed unknown type 'agenteditor.agent'.

bin/status.sh now adds two WATCH items next to the existing #523 / #765 ones:

  1. extension module not in git: <path>, for any modules/*.mxmodule that git does not track.
  2. project uses Agent Editor but <path> is missing, when no modules/AgentEditor*.mxmodule sits beside the .mpr and either of these is true:
    • analysis/app-facts/inventory.json lists AgentEditorCommons;
    • a mdlsource/*.mdl file holds a create agent statement.

Both layouts are handled: root, and app/, whether app/ is its own repo or part of the root repo. The check reads only local files and git ls-files, with no mxcli calls. The exit code (always 0) and every verdict are unchanged.

skills/mendix-agents.md (on demand) gets a new section, "A colleague's clone must run it too". It adds the learned rule "commit modules/*.mxmodule with the model; a sync of only .mpr + mprcontents/ drops extension types". It also adds the GenAI key / Encryption.EncryptionKey / GenAICommons.StoreTraces note. Each comes with a one-line failure example and a checklist row.

Left out (needs option 2): the empty agent references / missing selectedModel check (mendixlabs/mxcli#1867) and the unset runtime constants check. Both need a captured mxcli output of a real agent document, and building them on hand-written input would break field-proof rule 1.

Impact

Row Answer
Process No gate, no FAIL, nothing new blocks. Two new advisory WATCH items in bin/status.sh (screen and --brief), shown only on projects that have a .mxmodule or use Agent Editor. No new artifacts.
Dependencies bin/status.sh only: a new block, plus one more variable in the WATCH loop. Another open PR that edits the same WATCH for line would need a one-token merge. No new tools. New optional read: analysis/app-facts/inventory.json, produced by bin/app-facts.sh; the mdlsource/ grep covers projects that never ran it.
Context cost none: no always-loaded file touched. The baseline is 66,271 words on both master and the branch (render-routing.sh --check). mendix-agents.md is on demand (2,038 → 2,219 words).
Behaviour NOT RUN: a short learned rule in an on-demand skill; no Agent Editor fixture project exists for an A/B. Maintainer to accept or request A/B.
Runtime 0.010 s measured per status run (300 mdl scripts, one .mxmodule).

Time cost: per status run · 0.010 s measured on a Linux x86_64 container · can force rework: n · offset: maintainer OK

Field evidence: observed in a field project with Agent Editor agents (Nov 2026, reported in #778). It is UNVERIFIED against that project, since no Agent Editor project is available here. The fixture rebuilds the situation from real git repos in temp dirs.

Fixture: tests/wave2/test-status-extension-modules.sh (real bin/init-project.sh scaffold, real git repos, both layouts).

Script under test Passed Failed
master's bin/status.sh 3 5
this branch 8 0

On master, T1, T3, T5, T6 and T8 fail; only the negative cases pass.

Existing status.sh fixtures on the branch:

Fixture Result
test-status-existing-app 27/27, byte-diff unchanged
test-status-teamserver 10/10
test-status-lint-unversioned 4/4
test-status-session-cwd 10/10
test-status-bare-var 3/3

check-scripts.sh, the leak guard, check-pr-discipline.sh and check-portability.sh are clean.

  • No client data anywhere in the diff (the issue's project name is not repeated)
  • Size cap: 4 files, ~52 lines excluding fixture and CHANGELOG
  • Test tier reached: T1 (scoped fixture on real git repos; no live Agent Editor project)
  • For a new/changed instrument: no mxcli output is parsed (git and file existence only). Both layouts are covered by T1–T6. macOS / Git Bash: globs, grep -rqiE --include and git ls-files only.
  • For a new skill: n/a
  • CHANGELOG.md line appended, credited
  • New bug entries: n/a

Review: pending independent review


Generated by Claude Code

…ravel with the model (#778)

Studio Pro reads the agenteditor.agent type from modules/AgentEditor.mxmodule beside
the .mpr; a sync of only .mpr + mprcontents/ dropped it from git, so every colleague's
clone broke while the builder stayed green. bin/status.sh now WATCHes (warn-only, exit
code and verdicts unchanged, local git ls-files and file existence only, root and app/
layouts) a modules/*.mxmodule git does not track, and a project using Agent Editor
(inventory.json or a `create agent` statement) with no AgentEditor*.mxmodule.
skills/mendix-agents.md gains the learned rule and the GenAI key / constants note.
Agent reference and runtime-constant checks are left for option 2 (need a capture).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HXpQSjXefSNicGGqP4aiSC
@MendixMau

Copy link
Copy Markdown
Owner Author

Review: MERGE-AFTER-FIX. The create agent detector also matches comments and string literals, so a project that only mentions agents gets a false "uses Agent Editor" WATCH.

Value: Option 1 of #778, as decided. It adds two WATCH items (bin/status.sh:340-371) and the learned rule plus a checklist row in the on-demand mendix-agents.md. It is not overbuilt: references and constants are deferred.

Regression risk: No verdict or exit code changes.

Correctness:

  • The new fixture passes 8/0 on the branch and 3 pass / 5 fail on master.
  • Existing test-status-* fixtures are all green.
  • A probe showed the regex at :351 matching -- TODO: create agent … and 'please create agent first'.

Context cost: 66,271 → 66,271 (measured).

Time cost: per status.sh run, not per build row. Within budget.

Exact fixes required:

  1. Anchor the detector to a statement at line start, e.g. '^[[:space:]]*create[[:space:]]+(or[[:space:]]+(replace|modify)[[:space:]]+)?agent[[:space:]]' with -i. Add a fixture case where an .mdl holds only -- create agent later and a 'create agent' string, and assert there is no WATCH.
  2. (Nit) Put --include='*.mdl' before the pattern.

Generated by Claude Code

…at line start; T9 comment/string case

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HXpQSjXefSNicGGqP4aiSC
@MendixMau

Copy link
Copy Markdown
Owner Author

Review: MERGE (re-review). The detector is now anchored to a statement at line start, and --include comes before the pattern (bin/status.sh:351, fix c42846f).

Probes:

Input Matches
indented create agent X ( yes
create or replace / create or modify forms yes
CRLF lines yes
-- create agent no
'create agent' no
/* … */ no

The new T9 case fails against the pre-fix status.sh, so it really tests the fix.

Fixtures:

Fixture Result
extension-modules 9/0
existing-app 27/27
lint-unversioned 4/0
session-cwd 10/0
teamserver 10/0
bare-var 3/0

Always-loaded words are unchanged at 66,271.


Generated by Claude Code

@MendixMau
MendixMau merged commit ff4103b into master Nov 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check for Agent Editor projects: mxmodule tracked, agent references and model version filled, runtime constants set

2 participants